package com.szqhyxj.youxiangju.biz.creditCardEvaluation.evaluationRecord;

import com.google.gson.annotations.SerializedName;
import com.szqhyxj.youxiangju.BaseConsumer;
import com.szqhyxj.youxiangju.sys.BaseResult;
import com.szqhyxj.youxiangju.sys.RetrofitFacade;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.Retrofit;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by leung on 2018/11/10.
 */

public class EvaluationRecordModel {

    private interface EvaluationRecordService{

        @FormUrlEncoded
        @POST("creditcard/evaluation/getEvaluationRecordList")
        Observable<BaseResult<EvaluationRecordListEntity>> evaluationRecordList(
                @Field("pageNumber") int pageNumber,
                @Field("pageSize") int pageSize
        );
    }

    public static Observable<BaseResult<EvaluationRecordListEntity>> getEvaluationRecordList(int pageNumber,int pageSize){
        return RetrofitFacade.Companion.getRetrofit().create(EvaluationRecordService.class).evaluationRecordList(pageNumber,pageSize);
    }

    public static class EvaluationRecordListEntity{

        @SerializedName("total")
        private int total;

        @SerializedName("rows")
        private List<RowsItem> rows;

        public void setTotal(int total){
            this.total = total;
        }

        public int getTotal(){
            return total;
        }

        public void setRows(List<RowsItem> rows){
            this.rows = rows;
        }

        public List<RowsItem> getRows(){
            return rows;
        }

        @Override
         public String toString(){
            return
                "Response{" +
                "total = '" + total + '\'' +
                ",rows = '" + rows + '\'' +
                "}";
            }
    }
}
